package com.tc.service.impl;

import com.tc.service.CheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpHeaders;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.stereotype.Service;

@Service
public class CheckServiceImpl implements CheckService {
    @Autowired
    private RedisTemplate redisTemplate;

    @Override
    public Boolean check(String param) {
        //解析param
        String[] split = param.split(":");
        String openId=split[0];
        String id=split[1];
        //直接查询redis
        String s = (String) redisTemplate.opsForValue().get(id);
        //然后判断对错
        if(openId.equals(s)){
            return true;
        }
        return false;
    }
}
